package main.java.Thread;

public class MyDaemonThread {
    public static void main(String[] args) {
        DThread d = new DThread();
        d.setDaemon(true);
        d.start();
        for(int i = 0; i <=50;i++){
            System.out.println("主线程"+Thread.currentThread().getName());
        }
    }

}


class DThread extends Thread{
    @Override
    public void run() {
        while (true){
            System.out.println("守护线程安排"+ Thread.currentThread().getName());
        }
    }
}